<template>
  <div class="home">
    <el-container>
      <el-header class="top-box">
        <el-row :gutter="24">
          <el-col :span="18">
            <img class="logo" src="../assets/星源logo黑底.png" alt="">
          </el-col>
          <el-col :span="6">
            <div class="info-box">
              <span>Linjm</span>
              <el-link class="out-btn" type="primary" href="https://element-plus.org" target="_blank">退出</el-link>
            </div>
          </el-col>
        </el-row>
      </el-header>
      <el-container>
        <el-aside width="200px">
          <el-menu :router=true class="el-menu-vertical-demo">
            <el-menu-item v-for="i in tabList" :key="i.name" :index="i.name">
              <template #title>{{ i.meta.title }}</template>
            </el-menu-item>
          </el-menu>
        </el-aside>
        <el-main>
          <div class="content-box">
            <router-view />
          </div>
        </el-main>
      </el-container>

    </el-container>
  </div>
</template>

<script>

import router from '../router/index';

export default {
  name: 'HomeView',
  setup() {
    let tabList = router.options.routes[0].children;
    console.log(tabList)
    return {
      tabList,
    };
  },
};
</script>
<style lang="scss" scoped>
.top-box {
  background: #efefef;
  padding: 5px;

  .logo {
    width: 160px;
  }

  .info-box {
    text-align: right;
  }

  .out-btn {
    margin-left: 10px
  }

  .content-box {
    padding: 20px;
  }
}
</style>
